package com.ehotting.edsta.mqbd.config;

import com.ehotting.edsta.mqbd.cae.http.caller.CaeCaller;
import com.ehotting.edsta.mqbd.caeu.http.caller.CaeuCaller;
import com.ehotting.edsta.mqbd.call.HttpCaller;
import com.ehotting.edsta.mqbd.circuit.http.caller.CircuitCaller;
import com.ehotting.edsta.mqbd.diagnosisPredict.http.caller.DiagnosisPredictCaller;
import com.ehotting.edsta.mqbd.driverAdapt.http.caller.DriverAdaptCaller;
import com.ehotting.edsta.mqbd.reliability.http.caller.ReliabilityCaller;
import com.ehotting.edsta.mqbd.signal.netty.call.MqSignalTcpCaller;
import com.ehotting.edsta.mqbd.testability.http.caller.TestabilityCaller;
import com.ehotting.mqbd.core.manager.SolverStateManager;
import com.ehotting.mqbd.core.service.MQService;
import com.ehotting.mqbd.zw.netty.call.MQZwNettyCaller;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MqbdConsumerActionCfg {

    @Bean(name="httpCaller")
    public HttpCaller httpCaller(MQService mqService,SolverStateManager solverStateManager){
        HttpCaller caller = new HttpCaller() {
            @Override
            public String getModuleName() {
                return "工程";
            }
        };
        caller.setMqService(mqService);
        caller.setSolverStateManager(solverStateManager);
        return caller;
    }

    @Bean(name="mqZwNettyCaller")
    public MQZwNettyCaller mqZwNettyCaller(MQService mqService,SolverStateManager solverStateManager){
        MQZwNettyCaller caller = new MQZwNettyCaller();
        caller.setMqService(mqService);
        caller.setSolverStateManager(solverStateManager);
        return caller;
    }
    @Bean(name="reliabilityCaller")
    public ReliabilityCaller reliabilityCaller(MQService mqService,  SolverStateManager solverStateManager){
        ReliabilityCaller caller = new ReliabilityCaller();
        caller.setMqService(mqService);
        caller.setSolverStateManager(solverStateManager);
        return caller;
    }

    @Bean(name="mqSignalTcpCaller")
    public MqSignalTcpCaller mqSignalTcpCaller(MQService mqService,SolverStateManager solverStateManager){
        MqSignalTcpCaller caller = new MqSignalTcpCaller();
        caller.setMqService(mqService);
        caller.setSolverStateManager(solverStateManager);
        return caller;
    }

    @Bean(name="diagnosisPredictCaller")
    public DiagnosisPredictCaller diagnosisPredictCaller(MQService mqService,SolverStateManager solverStateManager){
        DiagnosisPredictCaller caller = new DiagnosisPredictCaller();
        caller.setMqService(mqService);
        caller.setSolverStateManager(solverStateManager);
        return caller;
    }

    @Bean(name="driverAdaptCaller")
    public DriverAdaptCaller driverAdaptCaller(MQService mqService,SolverStateManager solverStateManager){
        DriverAdaptCaller caller = new DriverAdaptCaller();
        caller.setMqService(mqService);
        caller.setSolverStateManager(solverStateManager);
        return caller;
    }

    @Bean(name="caeCaller")
    public CaeCaller caeCaller(MQService mqService,SolverStateManager solverStateManager){
        CaeCaller caller = new CaeCaller();
        caller.setMqService(mqService);
        caller.setSolverStateManager(solverStateManager);
        return caller;
    }

    @Bean(name="caeuCaller")
    public CaeuCaller caeuCaller(MQService mqService,SolverStateManager solverStateManager){
        CaeuCaller caller = new CaeuCaller();
        caller.setMqService(mqService);
        caller.setSolverStateManager(solverStateManager);
        return caller;
    }

    @Bean(name="testabilityCaller")
    public TestabilityCaller testabilityCaller(MQService mqService,SolverStateManager solverStateManager){
        TestabilityCaller caller = new TestabilityCaller();
        caller.setMqService(mqService);
        caller.setSolverStateManager(solverStateManager);
        return caller;
    }

    @Bean(name="circuitCaller")
    public CircuitCaller circuitCaller(MQService mqService, SolverStateManager solverStateManager){
        CircuitCaller caller = new CircuitCaller();
        caller.setMqService(mqService);
        caller.setSolverStateManager(solverStateManager);
        return caller;
    }

}